package Day2025_04_19;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Demo02 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();
        Set<String> hash = new HashSet<>();
        int ret = 0;
        for (int i = 0; i < n; i++) {
            char[] ch = in.nextLine().toCharArray();
            Arrays.sort(ch);
            StringBuffer s = new StringBuffer();
            for (char c : ch) s.append(c);
            String tmp = s.toString();
            if (!hash.contains(tmp)) {
                hash.add(tmp);
                ret++;
            }
        }
        System.out.println(ret);
    }
}
